<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="oSForm">

        <rich:panel>
            <f:facet name="header">Ordem de Servi&#231;o</f:facet>

 <rich:simpleTogglePanel label="Identificador da Ordem de Servico" switchType="ajax">
 
            <s:decorate id="dataField" template="layout/edit.xhtml">
                <ui:define name="label">Data</ui:define>
                <h:inputText id="data" required="false"
                             value="#{oSHome.instance.dataOs}">
                             <f:convertDateTime pattern="dd/MM/yyyy"/>
                             </h:inputText>
            </s:decorate>
            
 </rich:simpleTogglePanel>

 <rich:simpleTogglePanel label="Dados do Veiculo" switchType="ajax">
 
            <s:decorate id="cambioField" template="layout/edit.xhtml">
                <ui:define name="label">Cambio</ui:define>
                <h:inputText id="cambio" required="false"
                             value="#{oSHome.instance.cambio}"/>
            </s:decorate>

            <s:decorate id="veiculoField" template="layout/edit.xhtml">
                <ui:define name="label">Veiculo</ui:define>
                <h:inputText id="veiculo" required="false"
                             value="#{oSHome.instance.veiculo}"/>
            </s:decorate>

            <s:decorate id="placasField" template="layout/edit.xhtml">
                <ui:define name="label">Placas</ui:define>
                <h:inputText id="placas" required="false"
                             value="#{oSHome.instance.placas}"/>
            </s:decorate>
            
</rich:simpleTogglePanel>

 <rich:simpleTogglePanel label="Dados do Cliente" switchType="ajax">

            <s:decorate id="clienteNomeField" template="layout/edit.xhtml">
                <ui:define name="label">Nome</ui:define>
                <h:inputText id="clienteNome" required="false"
                             value="#{oSHome.instance.clienteNome}"/>
            </s:decorate>

            <s:decorate id="clienteCelularField" template="layout/edit.xhtml">
                <ui:define name="label">Celular</ui:define>
                <h:inputText id="clienteCelular" required="false"
                             value="#{oSHome.instance.clienteCelular}"/>
            </s:decorate>

            <s:decorate id="clienteFixoField" template="layout/edit.xhtml">
                <ui:define name="label">Fone Fixo</ui:define>
                <h:inputText id="clienteFixo" required="false"
                             value="#{oSHome.instance.clienteFixo}"/>
            </s:decorate>

            <s:decorate id="clienteCpfField" template="layout/edit.xhtml">
                <ui:define name="label">CPF</ui:define>
                <h:inputText id="clienteCpf" required="false"
                             value="#{oSHome.instance.clienteCpf}"/>
            </s:decorate>

            <s:decorate id="clienteRgField" template="layout/edit.xhtml">
                <ui:define name="label">RG</ui:define>
                <h:inputText id="clienteRg" required="false"
                             value="#{oSHome.instance.clienteRg}"/>
            </s:decorate>
            
</rich:simpleTogglePanel>

            <div style="clear:both"/>

        </rich:panel>

        <div class="actionButtons">
            <h:commandButton id="save"
                          value="Save"
                         action="#{oSHome.persist}"
                       rendered="#{!oSHome.managed}"/>
            <h:commandButton id="update"
                          value="Save"
                         action="#{oSHome.update}"
                       rendered="#{oSHome.managed}"/>
            <h:commandButton id="delete"
                          value="Delete"
                         action="#{oSHome.remove}"
                      immediate="true"
                       rendered="#{oSHome.managed}"/>
            <s:button propagation="end"
                               id="cancel"
                            value="Cancel"
                             view="/osList.xhtml"/>
        </div>

    </h:form>

</ui:define>

</ui:composition>
